{include file="public/account_head"}
<div class="pub_wid notice_cont" id="myConsignor">
    <div class="mes_left rg">
        <div class="message bgb widthauto radius">
            <h6>我的货主企业</h6>
            <div class="order_details">

                <ul>
                    <li class="fortab prepaids" :class="{'checked':selectQueryStatus==0}" @click="changeMemberCategory(0)">全部</li>
                    <li class="fortab prepaids2" :class="{'checked':selectQueryStatus==1}" @click="changeMemberCategory(1)">待审核</li>
                    <li class="fortab prepaids3" :class="{'checked':selectQueryStatus==2}" @click="changeMemberCategory(2)">已通过</li>
                    <li class="fortab prepaids4" :class="{'checked':selectQueryStatus==3}" @click="changeMemberCategory(3)">未通过</li>
                </ul>
            </div>
            <div>
                <div class="tablelist showdomdiv showsss" >
                    <div class="bgb member_box">
                        <div class="table_head widthauto"><span class="sma">ID</span><span class="big">公司名称</span><span class="sma">状态</span> </div>
                        <ul class="widthauto middl_ul">
                            <li v-for="(item,index) in list">
                                <a :href="'/index/logistics/myConsignorDetail/id/'+item.member_info_id">
                                    <span class="sma">{{(((current_page-1)*num)+index)+1}}</span>
                                    <span class="big">{{item.member_info_name}}</span>
                                    <span class="sma ing" :class="[{'ing':item.status==1},{'ok':item.status==2},{'end':item.status==3}]">{{statusMessage[item.status-1]}}</span>
                                </a>
                            </li>
<!--                            <li><a href="#"><span class="sma">2</span><span class="big">浙江新天力容器科技有限公司</span> <span class="sma end">未通过</span> </a></li>-->
<!--                            <li><a href="#"><span class="sma">3</span><span class="big">浙江新天力容器科技有限公司</span> <span class="sma ok">已通过</span> </a></li>-->
                        </ul>
                    </div>

                    <div class="widthauto pages_box">
                        <a @click="pageNumGetList(1)">首页</a>
                        <a @click="pageNextList(-1)">上一页</a>
<!--                        <a v-for="item in pageInfo.total" @click="pageNumGetList(item)">{{item}}</a>-->
                        <a v-for="(item,index) in pageInfo.total" :class="(index+1)==current_page?'pages_box_cur':''" @click="pageNumGetList(item)">{{item}}</a>
                        <a @click="pageNextList(1)">下一页</a>
                        <a @click="pageNumGetList(pageInfo.total)">尾页</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="lf two_left">
        <div class="about_nav">
            <ul class="widthauto">
                <li><a href="" class="down">账户中心</a></li>
                <p class="widthauto">
                    <a href="/index/logistics/index">我的信息</a>
                    <a href="/index/logistics/reset">修改密码</a></p>
                <li><a href="/index/logistics/myConsignor" class="cur">我的货主企业</a></li>
                <li><a href="/index/logistics/myApply"  >我的报名</a></li>
            </ul>
        </div>
        <div class="add_box"> <a href="#"><img src="/static/index/public/images/add_008.jpg" /></a> </div>
    </div>
</div>
{include file="public/footer"}
<script>
    var myApplyModel = new Vue({
        el:'#myConsignor',
        data:{
            current_page:'1',//当前页
            num:'15',//每页显示几条
            statusMessage:['未审核','已通过','未通过'],
            list:[],
            pageInfo:{},
            member_id:'',
            selectQueryStatus:0
        },
        methods:{
            changeMemberCategory:function(num){
                var el = this
                el.selectQueryStatus = num
                el.changeWhereGetList()
            },
            pageNumGetList:function(page){
                var el = this
                el.current_page = page
                el.getList()
            },
            pageNextList:function (num) {
                var el = this;
                var set_current_page = el.current_page*1+num
                console.log(el.current_page)
                if( set_current_page < 1){
                    $.customToastr("error","已经是第一页啦");
                    return;
                }
                if(set_current_page > el.pageInfo.total){
                    $.customToastr("error","已经是最后一页啦");
                    return;
                }
                el.current_page = set_current_page
                el.getList();
            },
            //条件更改无法从第一页查询，跳转方法
            changeWhereGetList:function(){
                var el = this
                el.current_page = 1
                el.getList()
            },
            getList:function () {
                let el = this
                var paging = {
                    "current_page":el.current_page,
                    'num':el.num
                }
                var where = {
                    'member_id':el.member_id
                }
                if(el.selectQueryStatus==1){
                    where['status'] = 1
                }
                if(el.selectQueryStatus==2){
                    where['status'] = 2
                }
                if(el.selectQueryStatus==3){
                    where['status'] = 3
                }
                var postDate = {
                    "where":where,
                    "paging":paging,
                }
                AjaxPost(postDate,'/index/logistics/getMyMemberInfoAddUserListPage').then((response)=>{
                    if(response.status == 1){
                        if(response.result.list){
                            el.list = response.result.list
                        }else{
                            el.list = []
                        }
                        if(response.result.pageInfo){
                            el.pageInfo = response.result.pageInfo
                        }else {
                            el.pageInfo = {}
                        }
                        console.log(response)
                    }

                })
            },
        },
        mounted(){
            this.$nextTick(function () {
                this.member_id = localStorage.getItem('memberId');
                this.getList()
                $(document).ready(function(){

                });
            })
        }
    })
</script>